package com.phpxiu.app.view.custom;

import android.annotation.TargetApi;
import android.content.Context;
import android.util.AttributeSet;
import android.widget.ImageButton;

/**
 * Created by WuJinZhou on 2016/5/10.
 */
public class ShareMenu extends ImageButton {
    private boolean isChecked=false;
    private String msgOn;
    private String msgOff;
    private int resOn;
    private int resOff;
    public ShareMenu(Context context) {
        super(context);
    }

    public ShareMenu(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    public ShareMenu(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
    }

    @TargetApi(21)
    public ShareMenu(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
        super(context, attrs, defStyleAttr, defStyleRes);
    }

    public boolean isChecked() {
        return isChecked;
    }

    public void refreshState(boolean checked){
        isChecked=checked;
        if(isChecked){
            setImageResource(resOn);
        }else{
            setImageResource(resOff);
        }
    }

    public int getResOn() {
        return resOn;
    }

    public void setResOn(int resOn) {
        this.resOn = resOn;
    }

    public int getResOff() {
        return resOff;
    }

    public void setResOff(int resOff) {
        this.resOff = resOff;
    }

    public String getMsgOn() {
        return msgOn;
    }

    public void setMsgOn(String msgOn) {
        this.msgOn = msgOn;
    }

    public String getMsgOff() {
        return msgOff;
    }

    public void setMsgOff(String msgOff) {
        this.msgOff = msgOff;
    }
}
